package com.luchao.back.service.impl;

import com.luchao.back.mapper.AdsMapper;
import com.luchao.back.mapper.FriendLinksMapper;
import com.luchao.back.pojo.Ads;
import com.luchao.back.pojo.FriendLinks;
import com.luchao.back.service.AdsService;
import com.luchao.back.service.FriendLinksService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AdsServiceImpl implements AdsService {

    @Autowired
    private AdsMapper adsMapper;

    @Override
    public List<Ads> getAdsByPage(int startNum, int pageSize) {
        return adsMapper.getAdsByPage((startNum - 1) * pageSize, pageSize);
    }

    @Override
    public long getAdsCount() {
        return adsMapper.getAdsCount();
    }

    @Override
    public int checkAds(String adcompany) {
        return adsMapper.checkAds(adcompany);
    }

    @Override
    public int addAds(Ads ads) {
        return adsMapper.addAds(ads);
    }

    @Override
    public int deleteAds(Integer adid) {
        return adsMapper.deleteAds(adid);
    }

    @Override
    public boolean batchDeleteAds(List<Ads> ads) {
        return adsMapper.batchDeleteAds(ads) > 0 ? true : false;
    }

}
